<!-- Adapted from https://discourse.gohugo.io/t/snippet-partial-for-creating-breadcrumbs-uses-bootstrap-4/15426/2 -->
{{ define "breadcrumb" }}
  {{ with .Parent }}
    {{ template "breadcrumb" . }}
    {{ if not .IsHome }}&nbsp;/&nbsp;&nbsp;{{end}}<a href="{{ .RelPermalink }}">{{ if .IsHome }}Home{{ else }}{{.Title}}{{ end }}</a>
  {{ end }}
{{ end }}
{{ if not .IsHome }}
    <!-- This cannot be and'ed with the condition above because
    `.Parent.IsHome` is nil pointer on the home page -->
    {{if not .Parent.IsHome}}
        <div class="breadcrumb">
            {{ template "breadcrumb" . }}
        </div>
    {{ end }}
{{ end }}
